How would you collect data to answer the following questions?
Example: Compare tread wear between two brands of tire.
Observed Statistic: \(\bar{x}_\text{diff} = -0.002\)
Randomization: Flip a coin for each pair. If heads, reverse the pair. If tails, leave it as is.
Which common exercise, jumping jacks or bicycle kicks, raises your heart rate more?
\[ \begin{align} H_0: \mu_d &= 0 \\ H_a: \mu_d &\neq 0 \\ \bar{x}_d &\approx 11.9545 \end{align} \]
JJ bicycle
1 118 118
2 146 124
3 134 92
4 94 80
5 146 111
6 114 112
7 132 124
8 118 124
9 116 97
10 101 82
11 112 143
12 99 97
13 112 88
14 118 123
15 88 83
16 70 73
17 106 87
18 108 137
19 124 98
20 143 96
21 92 70
22 131 100
JJvsBicycle data from the
dropdown menu. Discuss the following:
Example. Data on 68 textbooks, giving their bookstrore price and their price on Amazon.
Rows: 68
Columns: 5
$ subject <fct> "American Indian Studies", "Anthropology", "Arts and Architecture", "Asian",…
$ course_num <fct> M10, 2, 10, M60W, 4, 10, 2CW, 10, 19, 1A, 4, 2, 3, 3A, 12B, 1A, 1, 19, 20, 1…
$ bookstore_new <dbl> 47.97, 14.26, 13.50, 49.26, 119.97, 16.95, 11.96, 26.75, 9.96, 39.97, 132.75…
$ amazon_new <dbl> 47.45, 13.55, 12.53, 54.95, 124.80, 11.77, 10.87, 38.94, 8.99, 35.00, 78.67,…
$ price_diff <dbl> 0.52, 0.71, 0.97, -5.69, -4.83, 5.18, 1.09, -12.19, 0.97, 4.97, 54.08, -2.98…
# A tibble: 1 × 3
n meanDiff sdDiff
<int> <dbl> <dbl>
1 68 3.58 13.4
The mathematical model is very similar to the one-mean case:
\[ T = \frac{\bar{x}_\text{diff} - 0}{s_\text{diff}/\sqrt{n}} \]
The conditions are similar: Independence, large samples, or normality of the differences.
A confidence interval for \(\mu_\text{diff}\) is:
\[ \bar{x}_\text{diff} \pm t^\star_\text{df} \times \frac{s_\text{diff}}{\sqrt{n}} \]
As before, \(df = n-1\). Use
qt() to get \(t^\star\).
# A tibble: 1 × 3
n meanDiff sdDiff
<int> <dbl> <dbl>
1 68 3.58 13.4
Use the mathematical model to perform the above hypothesis test.
Obtain a \(T\) score using the formula
and a P-value using pt(). Write a sentence explaining your
conclusion in context.
Use the mathematical model to construct a 95% confidence interval for the mean difference in price between the bookstore and Amazon. Write a sentence interpreting your confidence interval in context.
Paired t-test
data: textbooks$bookstore_new and textbooks$amazon_new
t = 2.2012, df = 67, p-value = 0.03117
alternative hypothesis: true mean difference is not equal to 0
95 percent confidence interval:
0.3340641 6.8324064
sample estimates:
mean difference
3.583235
One Sample t-test
data: textbooks$price_diff
t = 2.2012, df = 67, p-value = 0.03117
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
0.3340641 6.8324064
sample estimates:
mean of x
3.583235